Objective
In this course, attendees will learn how to develop and customize device drivers for the Linux kernel.
Detailed agenda
- Introduction to the Linux kernel: kernel responsibilities, general architecture, development process and versioning, source code overview, license, source code navigation tools.
- Kernel configuration and build process: configuring the Linux kernel, compiling the kernel, kernel images, installing the kernel, compiling the device tree, passing parameters to the kernel.
- Kernel modules: monolithic vs microkernel architectures, Linux kernel modules, advantages of using modules, compiling and installing modules, CLI tools to manage kernel modules, passing parameters to modules, developing a kernel module, integrating a kernel module into Linux’s source code.
- Hardware devices: Linux hardware access, device classes, character device driver, major/minor number, implementing file operations, exchanging data with userspace, registering a character driver, deallocating resources, error handling.
- Accessing hardware: I/O access mechanisms (bus I/O, port I/O, memory mapped I/O), memory-mapped I/O with MMU, requesting an I/O region, mapping a physical address to a virtual address, accessing registers, I/O access APIs.
- Frameworks: Linux driver model, kernel frameworks (tty, alsa, framebuffer, v4l, mtd, input, hwmon, watchdog, rtc, etc), framebuffer driver, power supply driver, input driver, LED framework.
- GPIOLIB: accessing GPIOs on Linux, GPIOLIB, GPIO access in userspace (sysfs and chardev), APIs to access GPIOs in kernel space.
- Bus infrastructure: introduction to the bus infrastructure, architecture and advantages, power management, bus core and bus adapters, I2C bus analysis, analyzing an I2C device driver, registering a device on the bus, platform bus, platform drivers and platform devices.
- Device tree: device tree history and introduction, device tree syntax, properties and nodes, device tree examples, analyzing some device tree nodes, changes required in drivers to support device tree, device tree APIs, device tree organization, device tree bindings.
- Process management: processes and threads on Linux, the states of a task, Linux schedulers, real-time tasks, kernel threads, kernel threads API, events and synchronization, wait queues, completion variable.
- Interrupt handling: hardware interrupt events, interrupt handling in the kernel, registering an ISR, restrictions on interrupt handling, how to implement an ISR, dividing the handling of an ISR into two parts (top half and bottom half), tasklets, work queues, threaded IRQs.
- Concurrency management: multitasking and concurrency, Linux kernel concurrency, critical sections and mutual exclusion, atomic operations, locking, mutex, spinlocks.
- Final thoughts: additional links and resources, book recommendations, closing questions and comments.
For more details on the content of this training, you can download the agenda and the slides (in Portuguese).
Additional information
Students, engineers and software developers of embedded systems projects.
Command line interface, C language, embedded Linux architecture.
The course material contains the slides of the presentations, the book of activities and exercises, reference guides, and additional reference documents. All materials will be provided in an electronic format at the start of the training session.
The training exercises are executed in the Colibri i.MX6 Toradex module with the Aster carrier board and an expansion board with a lot of peripherals, including LEDs, buttons, trimpot, buzzer, UART, temperature sensor, 7-segment display, GPIO expander and accelerometer. The development kit is loaned to students to carry out practical activities during the training. If necessary, and depending on the needs of the contracting company, the training can be carried out on another hardware platform.
The training can be presented in the following languages: Brazilian Portuguese and English.
If you plan to train your team or a group of people, consider a training session inside your company. In an in-company training session, the company is responsible for providing the necessary resources needed for the training, including the training room, data projector and development machines. This model also brings big advantages for the company, since the cost of transportation and accommodation of several employees is reduced only to the instructor. If your company has a special requirement, we can study a program that meets your needs, like preparing the training material for a specific hardware platform or developing additional content. Don’t hesitate to get in touch via email or the contact page .
Open training sessions are presented in a pleasant environment, with a properly equipped laboratory and Internet access. Classes are usually presented full-time, with a stop for lunch and a coffee break in the morning. If you are interested in attending an open session but there are no classes available, send a message via the contact page and we will notify you as soon as new classes open.
Due to the need to use a development kit to carry out practical activities, this training cannot currently be carried out online.
Photos gallery
Some pictures from previous training sessions: